#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>
#include<QPalette>
#include<QColor>
#include<QPixmap>
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);setFixedSize(800,600);


    b1.setParent(this);
    b1.setFixedSize(200,60);b1.setFont(QFont("宋体",18));
    b1.setFlat(true);b1.setStyleSheet(" fontsize:1000px;color:white");
    b1.setText("关闭");
    b1.move(600,500);

    b2.setParent(this);
    b2.setFixedSize(200,60);b2.setFont(QFont("宋体",18));b2.setStyleSheet(" fontsize:1000px;color:blue");
    b2.setFlat(true);
    b2.setText("简单模式");
    b2.move(350,500);


    b3.setParent(this);
b3.setFlat(true);
 b3.setStyleSheet(" fontsize:1000px;color:red");b3.setFont(QFont("宋体",18));
 b3.setFixedSize(200,60);
    b3.setText("困难模式");
    b3.move(100,500);
    connect(&w,&jiemian::mysingal,this,&Widget::chuli);
    connect(&v,&jian::mysingal,this,&Widget::chuli1);
connect(&b2,&QPushButton::released,this,&Widget::change2);
    connect(&b3,&QPushButton::released,this,&Widget::change1);
    connect(&b1,&QPushButton::pressed,this,&Widget::close);
}

Widget::~Widget()
{
    delete ui;
}
void Widget::change1 (){
    w.show();
    this->hide();
}
void Widget::paintEvent(QPaintEvent *event){
    Q_UNUSED(event);
    QPixmap pixmap=QPixmap(":/res/20525294d1c65afae20c898018853f0.jpg").scaled(this->size());
    QPainter painter(this);
    painter.drawPixmap(this->rect(),pixmap);
}
void Widget::change2 (){
    v.show();
    this->hide();
}
void Widget::chuli()
{
    w.hide();show();
}

void Widget::chuli1()
{
    v.hide();show();
}
